--TEST--
CTPP Load/Unload Parse/Save (old style)
--FILE--
<?php
	error_reporting(E_ERROR);

	ini_set("ctpp.arg_stack_size",       "10240");
	ini_set("ctpp.code_stack_size",      "10240");
	ini_set("ctpp.steps_limit",          "10240");
	ini_set("ctpp.cache_bytecode",       "0");
	ini_set("ctpp.max_functions",        "1024");

	// Create new class
	$T = ctpp_new();

	if (is_resource($T)) { echo "ctpp_new: OK\n"; }
	else
	{
		echo "new ctpp: ERROR\n";
		exit();
	}

	// Load template
	$hello = ctpp_parse_template($T, "hello.tmpl");

	if (is_resource($hello)) { echo "ctpp_parse_template: OK\n"; }
	else
	{
		echo "ctpp_parse_template: ERROR\n";
		exit();
	}

	if (ctpp_save_bytecode($T, $hello, "hello.ct2")) { echo "ctpp_save_bytecode: OK\n";    }
	else                                             { echo "ctpp_save_bytecode: ERROR\n"; }

	if (ctpp_save_bytecode($T, $hello, "hello.ct2")) { echo "ctpp_save_bytecode: OK\n";    }
	else                                             { echo "ctpp_save_bytecode: ERROR\n"; }

	if (ctpp_free_bytecode($T, $hello)) { echo "ctpp_free_bytecode: OK\n";    }
	else                                { echo "ctpp_free_bytecode: ERROR\n"; }

	if (ctpp_free_bytecode($T, $hello)) { echo "ctpp_free_bytecode: OK\n";    }
	else                                { echo "ctpp_free_bytecode: ERROR\n"; }

	$hello = ctpp_load_bytecode($T, "hello.tmpl");

	if (is_resource($hello)) { echo "ctpp_load_bytecode: OK\n";    }
	else                     { echo "ctpp_load_bytecode: ERROR\n"; }

	$hello = ctpp_load_bytecode($T, "hello.ct2");

	if (is_resource($hello)) { echo "ctpp_load_bytecode: OK\n"; }
	else
	{
		echo "ctpp_load_bytecode: ERROR\n";
		exit();
	}

	if (ctpp_free_bytecode($T, $hello)) { echo "ctpp_free_bytecode: OK\n";    }
	else                                { echo "ctpp_free_bytecode: ERROR\n"; }

	if (ctpp_destroy($T)) { echo "ctpp_destroy: OK\n";    }
	else                  { echo "ctpp_destroy: ERROR\n"; }

	if (ctpp_destroy($T)) { echo "ctpp_destroy: OK\n";    }
	else                  { echo "ctpp_destroy: ERROR\n"; }

?>
--EXPECT--
ctpp_new: OK
ctpp_parse_template: OK
ctpp_save_bytecode: OK
ctpp_save_bytecode: OK
ctpp_free_bytecode: OK
ctpp_free_bytecode: ERROR
ctpp_load_bytecode: ERROR
ctpp_load_bytecode: OK
ctpp_free_bytecode: OK
ctpp_destroy: OK
ctpp_destroy: ERROR